package com.tools.common.enums;

import lombok.Getter;

@Getter
public enum NodeStatusEnum {
    PENDING("PENDING", "待处理"),
    PROCESSING("PROCESSING", "处理中"),
    COMPLETED("COMPLETED", "已完成"),
    FAILED("FAILED", "失败"),
    SKIPPED("SKIPPED", "已跳过");

    private final String code;
    private final String desc;

    NodeStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static NodeStatusEnum getByCode(String code) {
        for (NodeStatusEnum status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        return null;
    }
}